#ifndef _DRIVER_PWM_H_
#define _DRIVER_PWM_H_
#include "M510reg.h"
typedef struct _PWM_PARAM_SET
{
    uint8 grp;
    uint8 chnl;
    uint8 mode;
    uint8 intr;
    uint16 clk_sel;
    uint16 clk_div;
    uint32 dutyon;
    uint32 cycle;
} pwm_param_t, *p_pwm_param_t;
void pwm_enable(pwm_param_t *p_pwm_set, uint8 enable);
#if (CONFIG_EAR_IN == 1)
void pwm_ear_in_detect(uint8 enable);
#endif
#if CONFIG_PWM_LED
void pwm_led_enable(uint8 enable);
#endif
void pwm_init(void);
void pwm_gpio_second_func(void);
void pwm_uninit(void);
void pwm_prediv(uint8 group, uint8 div);
void pwm_mode(uint8 group, uint8 chan, uint32 end_value, uint32 duty_cycle);
void pwm0_setting(void);
void pwm1_setting(void);
void pwm2_setting(void);
void pwm3_setting(void);
void pwm_isr(void);
__inline void pwm_set_isr_busy(uint8 busy);
__inline uint8 pwm_get_isr_busy(void);

#endif
